# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-onelogin
_pkgname=onelogin-python-sdk
pkgver=3.1.6
pkgrel=1
pkgdesc="OpenAPI Specification for OneLogin"
url="https://github.com/onelogin/onelogin-python-sdk"
license="MIT"
arch="noarch"
depends="
	py3-dateutil
	py3-urllib3
	py3-frozendict
	py3-typing-extensions
	py3-certifi
	"
makedepends="
	py3-setuptools
	py3-gpep517
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-pytest-cov
	py3-pytest-randomly
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/onelogin/onelogin-python-sdk/archive/$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver
subpackages="$pkgname-pyc"
options="!check" # Failure due to factory-boy issues

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer "$builddir"/.dist/*.whl
	.testenv/bin/python3 -m pytest --cov=onelogin -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
44fccb05e82c55db82617c33cc0e2287699969d9a7f12a4992c0cd35c28b2215c66bef37849e45b5506df11524d1b143a2ab3ae16f001af51f0135c92d0801a4  py3-onelogin-3.1.6.tar.gz
"

